package eva.savant.businessobject.gl;

import eva.savant.businessobject.vt.Vista;
import eva.savant.businessobject.mt.Material;
import eva.savant.businessobject.cg.Credito;
import eva.savant.businessobject.cg.Preasiento;
import eva.savant.businessobject.cg.Flujocaja;
import eva.savant.businessobject.cg.DocumentoDetalle;
import eva.savant.businessobject.cg.Asiento;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Collection;

@Table(name="GL_TIPO")
@javax.persistence.Entity(name = "gl.Tipo")
public class Tipo extends eva.savant.businessobject.Entity {

    @Id
    @Column(name = "ID_TIPO", length = 5, nullable = false)
    private String id; //ID Tipo

    @ManyToOne
    @JoinColumn(name = "ID_CLASE", nullable = false)
    private Clase clase; //ID Clase

    @Basic
    @Column(name = "CODIGO", length = 3, nullable = false)
    private String codigo; //Codigo

    @Basic
    @Column(name = "NOMBRE", length = 30, nullable = false)
    private String nombre; //Nombre

    @Basic
    @Column(name = "VALOR", length = 14, precision = 4, nullable = true)
    private BigDecimal valor; //Valor

    @Basic
    @Column(name = "ABREVIACION", length = 15, nullable = false)
    private String abreviacion; //Abreviacion

    @OneToMany
    (mappedBy = "tipo")
    private Collection<Asiento> lsAsiento;

    @OneToMany
    (mappedBy = "tipo")
    private Collection<DocumentoDetalle> lsDocumentoDetalle;

    @OneToMany
    (mappedBy = "tipo")
    private Collection<Preasiento> lsPreasiento;

    @OneToMany
    (mappedBy = "tipo_volumen")
    private Collection<Material> lsMaterial;

    @OneToMany
    (mappedBy = "condpago")
    private Collection<Credito> lsCredito;

    @OneToMany
    (mappedBy = "tipo_condpago")
    private Collection<Vista> lsVista;


    public Tipo(String id, Clase clase, String codigo, String nombre, BigDecimal valor, String abreviacion, Integer operacionId, String sociedadId, Integer usuarioId) {

        this.id= id;

        this.clase= clase;

        this.codigo= codigo;

        this.nombre= nombre;

        this.valor= valor;

        this.abreviacion= abreviacion;

        this.operacionId= operacionId;

        this.sociedadId= sociedadId;

        this.usuarioId= usuarioId;

    }

    public Tipo() {

    }


    public String getId() {
    
        return id;
    }
    
    public void setId(String id) {
    
        this.id = id;
    }

    public Clase getClase() {
    
        return clase;
    }
    
    public void setClase(Clase clase) {
    
        this.clase = clase;
    }

    public String getCodigo() {
    
        return codigo;
    }
    
    public void setCodigo(String codigo) {
    
        this.codigo = codigo;
    }

    public String getNombre() {
    
        return nombre;
    }
    
    public void setNombre(String nombre) {
    
        this.nombre = nombre;
    }

    public BigDecimal getValor() {
    
        return valor;
    }
    
    public void setValor(BigDecimal valor) {
    
        this.valor = valor;
    }

    public String getAbreviacion() {
    
        return abreviacion;
    }
    
    public void setAbreviacion(String abreviacion) {
    
        this.abreviacion = abreviacion;
    }

    public Collection<Asiento> getLsAsiento() {
    
        return lsAsiento;
    }
    
    public void setLsAsiento(Collection<Asiento> lsAsiento) {
    
        this.lsAsiento = lsAsiento;
    }

    public Collection<DocumentoDetalle> getLsDocumentoDetalle() {
    
        return lsDocumentoDetalle;
    }
    
    public void setLsDocumentoDetalle(Collection<DocumentoDetalle> lsDocumentoDetalle) {
    
        this.lsDocumentoDetalle = lsDocumentoDetalle;
    }

    public Collection<Preasiento> getLsPreasiento() {
    
        return lsPreasiento;
    }
    
    public void setLsPreasiento(Collection<Preasiento> lsPreasiento) {
    
        this.lsPreasiento = lsPreasiento;
    }

    public Collection<Material> getLsMaterial() {
    
        return lsMaterial;
    }
    
    public void setLsMaterial(Collection<Material> lsMaterial) {
    
        this.lsMaterial = lsMaterial;
    }

    public Collection<Credito> getLsCredito() {
    
        return lsCredito;
    }
    
    public void setLsCredito(Collection<Credito> lsCredito) {
    
        this.lsCredito = lsCredito;
    }

    public Collection<Vista> getLsVista() {
    
        return lsVista;
    }
    
    public void setLsVista(Collection<Vista> lsVista) {
    
        this.lsVista = lsVista;
    }

}
